package edu.uc.ui.ctrl25;

public abstract class CrudAction extends BaseAction {
	private static final long serialVersionUID = 1L;
	
	protected String crud() {
		String result = "list";
		if(oper == null) {
			oper = "";
		} else {
			oper = oper.trim().toLowerCase();
		}
		result = oper;
		
		switch(oper) {
		case "list":
			result = list();
			break;
		case "listdeal":
			result = listDeal();
			break;
		case "insert":
			result = insert();
			break;
		case "insertdeal":
			result = insertDeal();
			break;
		case "update":
			result = update();
			break;
		case "updatedeal":
			result = updateDeal();
			break;
		case "detail":
			result = detail();
			break;
		case "detaildeal":
			result = detailDeal();
			break;
		case "deletedeal":
			result = deleteDeal();
			break;
		default:
			result = list();
			break;	
		}
		result = result.replace("deal", "");
		return result;
	}
	
	protected abstract String list();
	
	protected abstract String listDeal();
	
	protected abstract String insert();
	
	protected abstract String insertDeal();
	
	protected abstract String delete();
	
	protected abstract String deleteDeal();
	
	protected abstract String update();
	
	protected abstract String updateDeal();
	
	protected abstract String detail();
	
	protected abstract String detailDeal();
	
}
